package c15IO;

import java.io.Console;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Reader;

/**
 * 字符流测试
 *
 * @author 炜sama
 */
public class 字符流测试 {

	public void testReader() throws IOException {
		File f = new File("id");
		Reader r = new FileReader(f);
		System.err.println((char) r.read());
	}

	public void testPrintWriter() throws IOException {
		PrintWriter pw = new PrintWriter(System.err, true);
		pw.println("你妈逼");
		pw.println("你妈逼");
		pw.println("你妈逼");
		pw.println("你妈逼");
		pw.println("你妈逼");
//		pw.close();
	}

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		字符流测试 t = new 字符流测试();
//		Console cons;
//		char[] passwd;
//		if ((cons = System.console()) != null &&
//		(passwd = cons.readPassword("[%s]", "Password:"))!= null) {
//		java.util.Arrays.fill(passwd, ' ');
//		 }

		t.testPrintWriter();
	}

}
